<?php

namespace App\Http\Criteria;

use App\Repository\Criteria;
use App\Repository\Constracts\RepositoryInterface as Repository;

class TypeCriteria extends Criteria
{
    private $type;

    public function __construct($type)
    {
        $this->type = $type;
    }

    public function apply($model, Repository $repository)
    {
        return $model->where('type', $this->type);
    }

}
